#检查mysql主从同步
#!/bin/bash
user=root
passwd=123456
io_status=$(mysql -u$user -p$passwd -e show slave statusG | awk -F: /slave_.*_Running/{gsub(":",":");print $0})
for i in $io_status
do
thread_status_naem=${i%:*}
thread_status=${i#*:}
if [ "$thread_status" !="Yes" ];then
	echo "Error:Mysql master-slave $thread_status_name status is $thread_status!"
fi
done

